# -*- coding:utf-8 -*-

from com.mat.rpa.utils.globalConstants import GlobalConstants
from com.mat.rpa.views.workWindow.leftPanel.directiveTree import treeItem
from . import PDFFileOperationConstants

class PDFFileOperationSubDirectiveTree(treeItem.TreeItemWithID):
    def __init__(self, parent):
        super(PDFFileOperationSubDirectiveTree, self).__init__(parent)
        self.createPDFFileOperationTreeNode()

    def createPDFFileOperationTreeNode(self):
        self.nodeType = GlobalConstants.treeBranchType
        self.directiveType = "PDFFileOperation"
        self.setText(0,"PDF文件操作")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, PDFFileOperationConstants.PDFFileOperationConstants.extractingTextDirective, "提取文本")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, PDFFileOperationConstants.PDFFileOperationConstants.extractingImageDirective, "提取图片")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, PDFFileOperationConstants.PDFFileOperationConstants.exportingNewPDFFileDirective, "导出新PDF文档")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, PDFFileOperationConstants.PDFFileOperationConstants.mergingPDFFilesDirective, "合并PDF文件")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, PDFFileOperationConstants.PDFFileOperationConstants.savingSpecificPageAsImageDirective, "将指定也另存为图片")
